﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Register.ascx.cs" Inherits="UserControl_Register" %>
<%@ Register Src="~/UserControl/MyFrame.ascx" TagName="myframe" TagPrefix="uc" %>
<style type="text/css">
    .style1
    {
        width: 718px;
    }
    .style4
    {
        width: 233px;
    }
</style>
<div align="center">
    <table>
        <tr>
            <td class="style1">
               
                <asp:UpdatePanel runat="server" ID="updatePanel">
                    <ContentTemplate>
                        <table border="0">
                            <tr>
                                <td class="style4">
                                    <asp:Label ID="lblHoTen" runat="server" Text="Họ Tên"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtHoTen" runat="server" Width="290px" Height="25px"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" ControlToValidate="txtHoTen"
                                        ErrorMessage="Họ tên không được để trống" ValidationGroup="Register">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="style4">
                                    <asp:Label ID="lblTenDangNhap" runat="server" Text="Tên đăng nhập:"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="txtTenDangNhap" Width="290px" Height="25px"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="Requiredfieldvalidator2" runat="server" ErrorMessage="Tên đăng nhập không được để trống"
                                        ControlToValidate="txtTenDangNhap" ValidationGroup="Register">*</asp:RequiredFieldValidator> </td>
                                                      
                                <td>
                                    <asp:Literal ID="ltlErrorTenDangNhap" runat="server" Visible="False"></asp:Literal>
                                </td>
                            
                            </tr>
                            <tr>
                                <td class="style4">
                                    <asp:Label ID="lblMatKhau" runat="server" Text="Mật khẩu:"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="txtMatKhau" MaxLength="50" TextMode="Password" 
                                        Width="290px" Height="25px"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                                        ControlToValidate="txtMatKhau" ErrorMessage="Mật khẩu phải nhiều hơn 6 kí tự" 
                                        ValidationExpression="\w{6,}" ValidationGroup="Register">*</asp:RegularExpressionValidator>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                                        ControlToValidate="txtMatKhau" ErrorMessage="Mật khẩu không được bỏ trống" 
                                        ValidationGroup="Register">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="style4">
                                    <asp:Label ID="lblXNMatKhau" runat="server" Text="Xác nhận mật khẩu:"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="txtXNMatKhau" MaxLength="50" 
                                        TextMode="Password" Width="290px" Height="25px"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="Requiredfieldvalidator4" runat="server" ErrorMessage="Thiếu xác nhận mật khẩu"
                                        ControlToValidate="txtXNMatKhau" ValidationGroup="Register">*</asp:RequiredFieldValidator>
                                </td>
                                                        
                                <td>
                                    <asp:CompareValidator ID="Comparevalidator1" runat="server" ErrorMessage="Xác nhận mật khẩu không đúng"
                                        ControlToCompare="txtXNMatKhau" ControlToValidate="txtMatKhau" ValidationGroup="Register"></asp:CompareValidator>
                                </td>
                            
                            </tr>
                            <tr>
                                <td class="style4">
                                    <asp:Label ID="lblEmail" runat="server" Text="Email:"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="txtEmail" Width="290px" Height="25px"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                        ControlToValidate="txtEmail" ErrorMessage="Định dạng Email không hợp lệ" 
                                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                                        ValidationGroup="Register">*</asp:RegularExpressionValidator>
                                </td>
                                         
                                <td rowspan="6" align="left">
                                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="BulletList"
                                        ValidationGroup="Register" HeaderText="Lỗi:" />
                                </td>
                            
                                </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblCMND" runat="server" Text="CMND:"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="txtCMND" Width="290px" Height="25px"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                                        ControlToValidate="txtCMND" ErrorMessage="Định dạng CMND không hợp lệ" 
                                        ValidationExpression="[0-9]{1,}" ValidationGroup="Register">*</asp:RegularExpressionValidator>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                                        ControlToValidate="txtCMND" ErrorMessage="CMND không được để trống" 
                                        ValidationGroup="Register">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="style4">
                                    <asp:Label ID="lblDienThoai" runat="server" Text="Điện thoại:"></asp:Label>
                                </td>

                                <td>
                                    <asp:TextBox runat="server" ID="txtDienThoai" Width="290px" Height="25px"></asp:TextBox>
                                </td>

                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td class="style4">
                                    <asp:Label ID="lblDiaChi" runat="server" Text="Địa chỉ:"></asp:Label>
                                </td>
                                <td dir="ltr">
                                    <asp:TextBox runat="server" ID="txtDiaChi" Width="290px" Height="25px"></asp:TextBox>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td class="style4">
                                    <asp:Label ID="lblXacNhanHinhAnh" runat="server" Text="Xác nhận bằng hình ảnh"></asp:Label>
                                    
                                </td>
                            </tr>
                            <tr>
                                <td class="style4">
                                </td>
                                <td colspan="1">
                                    <asp:Image ID="Image1" runat="server" ImageUrl="~/Captcha.aspx"></asp:Image>
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td class="style4">
                                    <asp:Label ID="lblChuoiXacNhan" runat="server" Text="Nhập chuỗi xác nhận"></asp:Label>
                                </td>
                                <td colspan="1" align="left">
                                    <asp:TextBox ID="txtCaptcha" runat="server" Width="290px" Height="25px"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="Hình ảnh xác nhận không được để trống"
                                        ControlToValidate="txtCaptcha" ValidationGroup="Register">*</asp:RequiredFieldValidator>
                                </td>
                                                           
                                <td>
                                    <asp:Label ID="lblSaiChuoiXacNhan" runat="server" ForeColor="Red" Text="Chuỗi xác nhận không đúng"
                                        Visible="False"></asp:Label>
                                </td>
                         
                            </tr>


                        </table>
                         <br />
                         <br />

                            <center>
                            <asp:Button runat="server" Text="Đăng ký" ID="btnDangKy" ValidationGroup="Register" CssClass="exclusive"          
                                        OnClick="btnDangKy_Click" />
                             </center>
                               
                                    
                            

                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnDangKy" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
</div>
